package com.viethp.mt.objects;

import org.ksoap2.serialization.SoapObject;

public class AcceptApplicantResponse {
	private static final String ERROR_CODE = "ErrorCode";
	private static final String XML_STATUS = "status";
	private ErrorCode errorCode;
	private int status;

	public AcceptApplicantResponse(SoapObject result) {
		if (result != null && result.hasProperty(ERROR_CODE)) {
			this.errorCode = new ErrorCode(
					(SoapObject) result.getProperty(ERROR_CODE));
		} else {
			this.errorCode = null;
			if (result.hasProperty(XML_STATUS)) {
				this.status = Integer.parseInt(result.getProperty(XML_STATUS)
						.toString());
			} else
				this.status = 0;
		}
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(ErrorCode errorCode) {
		this.errorCode = errorCode;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
}
